import request from './request'
import qs from 'qs'
//按需导出精品推荐请求
export const JingpinApi = () => request.get("/products/recommend")
//按需导出post请求传参数
//手机发送验证码
export const SendCodeApi = (params) => request.post("/sendSMS",qs.stringify(params))

//登录注册模块
export const PhoneLoginApi = (params) => request.post("/phoneRegin", qs.stringify(params))
// 微信登录（这个接口必须用qs对数据进行格式化）
export const WeixinLoginApi = (params) => request.post(`/wechatUsers/PCLogin`, qs.stringify(params));
// 验证码登录
export const CodeLoginApi = (params) => request.post(`/phoneRegin`, qs.stringify(params));
 
// 获取用户信息
export const UserProfilesApi = () => request.get(`/shop/userProfiles`);
// 获取热门兑换信息
export const HotApi = () => request.get(`/products/hot`);
// 获取商品详情信息(get请求形参必须是params，post无所谓)
export const GoodsDetailApi = (params) => request.get(`/products/${params.id}`);

// 加入购物车
export const AddToCartApi = (params) => request.post(`/shop/carts/add`, qs.stringify(params));
//全部商品
export const AddGoodsApi = (params) => request.get(`/products`, { params });
//获取购物车
export const CartDataApi = () => request.get(`/shop/carts`);
//删除购物车商品
export const DeleteDataApi = (params) => request.delete(`/shop/carts?productIds=${params.id}`);


